<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>侦听器</title>
    <script src="vue3.js"></script>
</head>
<body>
    <div id="app">
        <h1>{{msg}}</h1>
        <input v-model="msg"/>
    </div>
    <script>
        const {createApp} = Vue
        createApp({
            data(){
                return{
                    msg:'hello world'
                }
            },
            watch:{
                msg(newMsg){
                    console.log(newMsg)
                }
            }
        }).mount('#app')
    </script>
</body>
</html>